import React from 'react'
import { Form, Select, Input } from 'antd'
/*import StandardStore from 'pages/serviceStandard/stores/standard'
import StateMixin from 'reflux-state-mixin'*/
const FormItem = Form.Item;
const Option = Select.Option
let StandardForm =  React.createClass({
  // mixins: [StateMixin.connect(StandardStore)],
  render() {
    const {getFieldProps} = this.props.form;
    const formItemLayout = {
      labelCol: {
        span: 5
      },
      wrapperCol: {
        span: 12
      }
    }
    const standardLevel = getFieldProps('standardLevel', {
      initialValue: this.props.model.standardLevel
    });
    const responseUnit = getFieldProps('responseUnit', {
      initialValue: this.props.model.responseUnit
    })
    const handleUnit = getFieldProps('handleUnit', {
      initialValue: this.props.model.handleUnit
    })
    return (
      <Form horizontal onSubmit={this.handleSubmit} className="ticket-form"> 
        <FormItem  {...formItemLayout} label="标准级别">
          <Select {...standardLevel}>
            <Option value="极高">极高</Option>
            <Option value="高">高</Option>
            <Option value="中">中</Option>
            <Option value="低">低</Option>
            <Option value="极低">极低</Option>
          </Select>
        </FormItem>
        <FormItem  {...formItemLayout} label="响应时间" hasFeedback>
          <Input type="text" {...getFieldProps('responseLimit', _.merge({
            initialValue: this.props.model.responseLimit },
            {rules: [{ required: true,validator: this.handleCheck }]}
          ))}/>
        </FormItem>
        <FormItem  {...formItemLayout} label="响应时间单位">
          <Select {...responseUnit}>
            <Option value="天">天</Option>
            <Option value="小时">小时</Option>
            <Option value="分">分</Option>
          </Select>
        </FormItem>
        <FormItem  {...formItemLayout} label="处理时间" hasFeedback>
          <Input type="text" {...getFieldProps('handleLimit', _.merge({
            initialValue: this.props.model.handleLimit },
            {rules: [{ required: true,validator: this.handleCheck }]}
          ))}/>
        </FormItem>
        <FormItem  {...formItemLayout} label="处理时间单位">
          <Select {...handleUnit}>
            <Option value="天">天</Option>
            <Option value="小时">小时</Option>
            <Option value="分">分</Option>
          </Select>
        </FormItem>
      </Form>      
    )
  }
})

StandardForm = Form.create()(StandardForm)
export default StandardForm;


